package org.scboy.coobi.log;

import org.apache.dubbo.config.annotation.DubboReference;
import org.scboy.logger.api.ILoggerManager;
import org.scboy.utils.entitys.coobi.DataAlterTable;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;

@Configuration
@EnableAsync
public class DataAlterService {
	
	Log log=LogFactory.get();
	
	@DubboReference(check=false)
	ILoggerManager manager;
	
	/**
	 * 同步记录日志
	 * @param type
	 * @param alterTable
	 */
	@Async
	public void dataAlert(String type,DataAlterTable alterTable) {
		if(manager!=null) {
			manager.writeDataBaseLog(type,alterTable);
		}
	}
}
